package ExamLab.Test1;

public class XMap implements Runnable{

    static String s="ABC";

    public void run(){
         synchronized(this){
              System.out.print(s);
         }
    }

    public static void main(String args[])throws Exception{
         Thread td=new Thread(new XMap());
         synchronized(td){
              td.start();
              Thread.sleep(1000);
              s="XYZ";
              System.out.print(s);
         }
    }

}